package day0309;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class Demo07 {

    public static void main(String[] args) {
//        Properties properties = new Properties();

//        properties.put("name", "zhangsan");
//        properties.put("age", "18");
//
//        try {
//            properties.store(new FileOutputStream("d://pro.properties"), "properties-test");
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }

//        Map<String, String> getenv = System.getenv();
//
//        Set<String> strings = getenv.keySet();
//
//        for (String str : strings) {
//            System.out.println(str + " = " + getenv.get(str));
//        }

        Properties properties = System.getProperties();

        Set<Object> objects = properties.keySet();

        for (Object obj : objects){
            System.out.println(obj + " = " + properties.get(obj));
        }
    }
}
